{% extends 'home/base.html' %}

{% block title %}Update stock(不填默认继承原值){% endblock %}
{% block heading %}Update stock(不填默认继承原值){% endblock %}
{% block body %}

<div class="container">
<div class="row">
  <form class="col s12" action='/stock/do_change_stock/' method="POST">
    {%csrf_token%}
    <div class="row">
      <input type='hidden' name='id' value='{{stock.pk}}'>
      <div class="input-field col s12">
        <input type="number" name='quantity' id="quantity" placeholder={{stock.quantity }}>
        <label for="quantity" class="active">quantity</label>
      </div>
        <div class="input-field col s6">
        <input type="date" name='purchase_date' id="purchase_date" placeholder={{stock.purchase_date }}>
        <label for="cpurchase_date" class="active">purchase_date</label>
      </div>
      <div class="input-field col s6">
        <input type="date" name='expiry_date' id="expiry_date" placeholder={{stock.expiry_date }}>
        <label for="expiry_date" class="active">expiry_date</label>
      </div>
      <button type="submit" class="btn grey">Update the stock</button>
    </div>
  </form>
  <a href="/stock/delete_stock/{{stock.pk}}"><button class="btn red">Delete this stock</button></a>
</div>
</div>
{% endblock %}
